namespace SkypeControl
{
    public class SkypeProxy : ISkypeProxy
    {
        private readonly SkypeClient mySkypeClient = new SkypeClient();

        public SkypeProxy()
        {
            this.mySkypeClient.SkypeAttach += this.mySkypeClient_OnSkypeAttach;
            this.mySkypeClient.SkypeResponse += this.mySkypeClient_SkypeResponse;
        }

        public event SkypeAttachHandler SkypeAttach;

        public event SkypeResponseHandler SkypeResponse;

        private void mySkypeClient_OnSkypeAttach(object theSender, SkypeAttachEventArgs theEventArgs)
        {
            if (this.SkypeAttach != null)
            {
                this.SkypeAttach(this, theEventArgs);
            }
        }

        private void mySkypeClient_SkypeResponse(object theSender, SkypeResponseEventArgs theEventArgs)
        {
            if (this.SkypeResponse != null)
            {
                this.SkypeResponse(this, theEventArgs);
            }
        }

        public bool Connect()
        {
            return this.mySkypeClient.Connect();
        }

        public void Disconnect()
        {
            this.mySkypeClient.Disconnect();
        }

        public bool Command(string theCommand)
        {
            return this.mySkypeClient.Command(theCommand);
        }
    }
}
